#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string>
#include "comm.hpp"

int main()
{

    int fd=open(FIFO_FILE,O_WRONLY|O_TRUNC);
    if(fd<0)
    {
        std::cerr<<"open error"<<std::endl;
        return 2;
    }

    while(1)
    {
        std::cout<<"please enter#:";
        std::string message;
        std::cin>>message;

        int n=write(fd,message.c_str(),message.size());
        if(n>0)
        {
        }
    }

    close(fd);
    return 0;


}